<script type="text/javascript">
    jQuery(document).ready(function(){
        $('ul#example').collapsibleCheckboxTree();
    });
</script>

<?php
if($confirmacao)
{
    echo '<h1>Matrícula de aluno em turma</h1>
          <h3>Confirme as informações</h3>';
    echo  '<font>'.$aluno["nome"].' (Matricula: '.$aluno["username"].')</font>';
    echo '<p><p><font>Turmas Selecionadas</font></p>';
    foreach ($turmas as $turma)
    {
        echo '<p>Disciplina: '.$turma["disciplina"]["nome"].'('.$turma["disciplina"]["id"].')';
        echo '   Turma: '.$turma["id"];
    }
    echo '';
    echo '<form action="/admin/resultadoInserirTurma" method="post">';
    echo "<input type='hidden' name='id_aluno' value='".$aluno["id"]."'>";
    echo "<input type='hidden' name='turmas' value='".serialize($turmas)."'>";
    echo '<input type="submit" class="button" value="Confirmar" /></p>
          </form><br/>';
    echo '<form action="/admin/inserirTurma" method="post">';
    echo '<input type="submit" class="button" value="Cancelar" /></p>
          </form>';


}
else {
    echo '<h1>Matricula de Aluno em Turma</h1>
         <form action="/admin/inserirTurma" method="post">
         Matricula Aluno: <input name="username" type="text" class="inputgri" />
         <h3>Selecione as Turmas a serem matriculadas</h3>
         <ul id="example">';
    foreach ($disciplinas as $aux=> $disciplina) {
        echo '<li>
            <input type="checkbox" /> '.$disciplina["id"].'-'.$disciplina["nome"];
        echo '<ul>';
        foreach ($disciplina["turma"] as $turma) {
            echo "<li><input type='radio' name='turma_".$aux."' value='".serialize($turma)."'/>".$turma["id"]." </li>";
        }
        echo '</ul>';
        echo '</li>';
    }
    echo '</ul>';
    echo '<input type="submit" class="button" value="Enviar" /></p>
             </form>';
}



?>

